package org.example.book.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.example.book.entity.Book;

import java.util.List;

@Mapper
public interface BookMapper {
//    @Select("select * from t_book")
    public List<Book> getBooks();

//    @Select("select * from t_book where id=#{id}")
    public Book getBookById(@Param("id") Long id);

    public List<Book> getBooksByConditions(@Param("type") String type, @Param("name") String name ,@Param("information") String information);

    public int updateBook(Book book);

//    @Delete("DELETE FROM t_book WHERE id = #{id}")
    public int deleteBook(@Param("id") Long id);

    public int addBook(Book book);
}
